<template>
  <div class="car">
      <table border="1" cellspacing="0" width="80%" style="margin:0 auto">
          <tr>
              <th>产品</th>
              <th>价格</th>
              <th>数量</th>
              <th>操作</th>
          </tr>
          <tr v-for="(v,k) in $store.state.car" :key="k">
              <td>{{v.pro}}</td>
              <td>{{v.p}}</td>
              <td>{{v.num}}</td>
              <td><button @click="add(v,k)">+</button></td>
          </tr>
      </table>
      <el-button type="danger" round @click="gai()">危险按钮</el-button>
      car...
      {{$store.state.info}}
      {{$store.state.mmd}}
      <!-- <button @click="gai()">改</button> -->
  </div>
</template>

<script>
// import axios from "axios"
export default {
   data(){
       return{

       }
   },
   methods:{
      gai(){
          this.$store.commit("egz","大狗子")// 
        //   console.log(66666)
      },
      add(v,k){
          let n=v.num
          n++
        //  v.num++,
         this.$store.commit("chcar",[n,k])
      }
   },
   mounted(){
       console.log(this.$store.state.info)
       this.$axios.get("/home/swiperdata")
       .then(res=>{
           console.log(res)
       })
   }
}
</script>

<style>

</style>